//
//  LandscapeTableView.h
//  ColumnWidget
//
//  Created by -_Asuna on 16/8/12.
//  Copyright © 2016年 David. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol LandscapeTableViewDataSource;
@protocol LandscapeTableViewDelegate;

@interface LandscapeTableView : UIView<UIScrollViewDelegate>
{
    UIScrollView *_scrollView;
    //判断视图是否在滑动
    BOOL _isScrolling;
}
//左边可见cell的索引
@property (nonatomic) NSInteger leftVisibleIndex;
//右边可见cell的索引
@property (nonatomic) NSInteger rightVisibleIndex;
//当前cell的索引
@property (nonatomic) NSInteger currentIndex;
//滑动停止后显示的新cell的索引
@property (nonatomic) NSInteger newIndex;
//左右两边预加载cell个数
@property (nonatomic) NSUInteger preLoad;
//cell个数
@property (nonatomic) NSUInteger cellCounts;
//可充用cell集合
@property (nonatomic,strong) NSMutableSet *reusableCells;
@property (nonatomic,strong) id<LandscapeTableViewDataSource> dateSource;
@property (nonatomic,strong) id<LandscapeTableViewDelegate> delegate;

-(void) setLocationWithIndex:(NSUInteger)index;
-(UIView *)dequeueReusableCell;
@end


#pragma mark- dataSource and delegate
@protocol LandscapeTableViewDataSource
-(NSUInteger)numberOfCells;
-(UIView *)cellAtIndex:(NSUInteger)index;
@end

@protocol LandscapeTableViewDelegate
-(void)showingIndex:(NSUInteger)index offset:(CGFloat)offset;
-(void)tableViewDidChangePageWithIndex:(NSUInteger)index;
-(void)tableViewDidBeginScrollingFromIndex:(NSInteger)sourceIndex ToIndex:(NSInteger)destIndex offset:(CGFloat)offset;
@end












